﻿using System;
using System.Data;
using System.Collections.Generic;
using Maticsoft.Common;
using kim.Model;
namespace kim.BLL
{
	/// <summary>
	/// CClass
	/// </summary>
	public partial class CClass
	{
		private readonly kim.DAL.CClass dal=new kim.DAL.CClass();
		public CClass()
		{}

        /// <summary>
        /// 分页控制
        /// </summary>
        /// <param name="tbname">要分页显示的表名</param>
        /// <param name="FieldKey">用于定位记录的主键(惟一键)字段,可以是逗号分隔的多个字段</param>
        /// <param name="PageCurrent">要显示的页码</param>
        /// <param name="PageSize">每页的大小(记录数)</param>
        /// <param name="FieldShow">以逗号分隔的要显示的字段列表,如果不指定,则显示所有字段</param>
        /// <param name="FieldOrder">以逗号分隔的排序字段列表,可以指定在字段后面指定DESC/ASC,用于指定排序顺序</param>
        /// <param name="Where">查询条件</param>
        /// <returns></returns>
        public DataSet GetNewsPager(int PageCurrent, int PageSize, string FieldShow, string FieldOrder, string Where)
        {
            return dal.GetNewsPager("CClass", "id", PageCurrent, PageSize, FieldShow, FieldOrder, Where);
        }

        public int GetMaxSort(string StrWhere)
        {
            return dal.GetMaxSort(StrWhere);
        }
        public string GetTitle(int id)
        {
            return dal.GetTitle(id);
        }
        public bool Add(kim.Model.CClass model)
        {
            return dal.Add(model);
        }
        public IList<kim.Model.CClass> GetTopCClass(int Top, string strWhere, string filedOrder)
        {
            return dal.GetTopCClass(Top, strWhere, filedOrder);
        }
        /// <summary>
        /// 更新类名
        /// </summary>
        public bool UpdateField(int id, string strValue)
        {
            return dal.UpdateField(id, strValue);
        }
        public bool UpDate(kim.Model.CClass model)
        {
            return dal.Update(model);
        }
        public bool Del(int id) { return dal.Del(id); }

        public kim.Model.CClass GetModel(int id) { return dal.GetModel(id); }

        public DataTable GetChildListT(int parent_id, int channel_id)
        {
            return dal.GetChildListT(parent_id, channel_id);
        }
        public DataSet GetChildList(int parent_id, int channel_id)
        {
            return dal.GetChildList(parent_id, channel_id);
        }

        public DataTable GetList(int parent_id, int channel_id)
        {
            return dal.GetList(parent_id, channel_id);
        }
        public int GetParentId(int id)
        {
            return dal.GetParentId(id);
        }
	}
}
